.react-datepicker,
.react-datepicker__month-dropdown,
.react-datepicker__year-dropdown {
  border: none;
  box-shadow: 0px 2px 6px rgba(10, 51, 100, 0.1), 0px 1px 2px rgba(13, 51, 108, 0.16);
  background-color: $white;
}

.react-datepicker {
  button {
    outline: none;
  }
}

.react-datepicker-popper {
  z-index: 10;
}

.react-datepicker__navigation {
  background: none;
  line-height: 1.7rem;
  text-align: center;
  position: absolute;
  top: 10px;
  padding: 0;
  border: 0.45rem solid transparent;
  z-index: 1;
  height: 10px;
  width: 10px;
  text-indent: -999em;
  overflow: hidden;
}

.react-datepicker__navigation--previous {
  left: 10px;
  border-right-color: $gray-400;

  &:hover,
  &:focus,
  &:active {
    border-right-color: $gray-500;
  }
}

.react-datepicker__navigation--next {
  right: 10px;
  border-left-color: $gray-400;

  &:hover,
  &:focus,
  &:active {
    border-left-color: $gray-500;
  }
}

.react-datepicker__header {
  background-color: $white !important;
  border-bottom: 1px solid rgba(171, 189, 218, 0.26);
  padding-top: 0.5rem;

  text-align: center;
}

.react-datepicker__month-read-view--selected-month,
.react-datepicker__year-read-view--selected-year {
  margin-right: 0.5rem;
}

.react-datepicker__year-option,
.react-datepicker__month-option {
  &:hover,
  &:focus {
    background-color: $gray-200;
  }
}

.react-datepicker__month,
.react-datepicker__day-names {
  margin: 0;
  padding: 0.5rem;
}

.react-datepicker__current-month {
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 700;
}

.react-datepicker__week,
.react-datepicker__day-names {
  display: flex;
  justify-content: space-between;
}

.react-datepicker__day--today {
  font-weight: 700;
}

.react-datepicker__day,
.react-datepicker__day-name {
  padding: 0.5rem;
  margin: 0.125rem;
  width: auto;
  min-width: 2.125 * $space;
  border-radius: 50%;
  font-size: $font-size-base;
  line-height: $font-size-base;
  color: $gray-900;
  text-align: center;

  &:hover,
  &:focus {
    outline: none;
  }
}

.react-datepicker__day {
  &:hover,
  &:focus {
    background-color: rgba($primary, 0.1);
  }
}

.react-datepicker__day--selected,
.react-datepicker__day--keyboard-selected {
  background-color: $primary;
  color: $white;
  text-align: center;

  &:hover,
  &:focus {
    background-color: darken($primary, 8%);
  }
}

.react-datepicker__day--outside-month {
  color: $gray-600;
}

.react-datepicker__month-dropdown-container--scroll,
.react-datepicker__year-dropdown-container--scroll {
  display: inline-block;
  margin-right: 1.25rem;
  cursor: pointer;
}

.react-datepicker__month-read-view,
.react-datepicker__year-read-view {
  border: 1px solid transparent;
}

.react-datepicker__month-read-view--down-arrow,
.react-datepicker__year-read-view--down-arrow {
  border-top-color: $gray-400;
  float: right;
  margin-left: 1.25rem;
  top: 8px;
  position: relative;
  border-width: 0.45rem;
  cursor: pointer;

  &::before {
    bottom: -1px;
    border: 6px solid transparent;
    border-top-color: $gray-400;
    border-bottom: none;
    content: '';
    left: -8px;
    top: 0;
    position: absolute;
    box-sizing: content-box;
    height: 0;
    width: 1px;
  }
}

.react-datepicker__month-read-view--down-arrow:hover:before,
.react-datepicker__year-read-view--down-arrow:hover:before {
  border-top-color: $gray-500;
}

.react-datepicker__month-dropdown,
.react-datepicker__year-dropdown {
  position: absolute;
  width: 50%;
  left: 25%;
  top: 24px;
  z-index: 11;
  text-align: center;
  border-radius: 0.3rem;
}

.react-datepicker__year-dropdown--scrollable {
  max-height: 250px;
  overflow-y: auto;

  &::-webkit-scrollbar {
    width: 0.25rem;
    border-radius: 16px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: $lightSapphire;
    border-radius: 16px;
  }
}

.react-datepicker__month-option--selected {
  position: absolute;
  left: 15px;
}

.react-datepicker__header__dropdown {
  font-size: 14px;
}

.react-datepicker__day--disabled {
  color: $gray-600;
  cursor: default;

  &:hover,
  &:focus {
    background-color: transparent;
  }
}

.react-datepicker__time {
  max-height: 276px;
  overflow: auto;
  text-align: center;
  min-width: 150px;

  &::-webkit-scrollbar {
    width: $space-x1;
    border-radius: $space-x4;
  }

  &::-webkit-scrollbar-thumb {
    background-color: $lightSapphire;
    border-radius: $space-x4;
  }
}

.react-datepicker__header--time,
.react-datepicker__header--time--only {
  padding: $space-x1 0;
  font-weight: 700;
  display: none;
}

.react-datepicker__time-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.react-datepicker__time-list-item {
  padding: $space-x1 $space-x2;
  cursor: pointer;

  &:hover,
  &:focus {
    outline: none;
    background-color: rgba($mainBlue, 0.1);
  }

  &:active {
    background-color: $mainBlue;
    color: $white;
  }
}

.react-datepicker__time-list-item--disabled {
  cursor: default;
  color: $gray-600;

  &:hover,
  &:focus {
    background-color: transparent;
    color: $gray-600;
  }
}

.react-datepicker__time-list-item--selected {
  background-color: $mainBlue;
  color: $white;
  font-weight: 700;

  &:hover,
  &:focus {
    background-color: darken($mainBlue, 8%);
  }
}

.react-datepicker__input-container {
  position: relative;
}

.date-picker-wrapper {
  .react-datepicker__close-icon {
    position: absolute;
    background-color: transparent;
    border: none;
    outline: none !important;
    top: 8px;
    right: 5px;
    padding: 0;

    &:after {
      background-color: transparent;
      color: $gray-600;
      border-radius: 50%;
      content: '\00d7';
      font-size: 28px;
      padding: $i-space-x1 $i-space-x3;
    }
  }

  &.round {
    &.date-lg {
      .react-datepicker__close-icon {
        top: 8px !important;

        &:after {
          padding: $i-space-x1 $i-space-x3;
          font-size: 28px !important;
        }
      }
    }
  }

  &.date-sm,
  &.round {
    .react-datepicker__close-icon {
      top: 4px;
      right: 6px;

      &:after {
        padding: 0 $space-x1;
        font-size: 22px;
      }
    }
  }

  .react-datepicker__close-icon:hover:after {
    color: $danger;
  }
}
